home *** CD-ROM | disk | FTP | other *** search
/ Ultra Pack / UltraComputing Technology Demos and Tools.iso / run_demo < prev   
Text File  |  1996-06-10  |  5KB  |  159 lines

  1. #!/bin/sh
  2. ####################################################################################
  3. #                                                                                  #
  4. #  Copyright (c) 1996, Sun Microsystems Computer Corporation, Mountain View, CA    #
  5. #                                                                                  #
  6. #                      All Rights Reserved                                         #
  7. #                                                                                  #
  8. # Sun Microsystems Computer Corporation disclaims all warranties with              #
  9. # regard to this software, including all implied warranties of merchantability     #
  10. # and fitness.  In no event will Sun Microsystems Inc., Sun Microsystems           #
  11. # Computer Corporation or any Sun Microsystems Inc. company, its employees         #
  12. # or agents be liable for direct, incidental or consequential damages              #
  13. # resulting from loss of data or business opportunities, resulting from the        #
  14. # Ultracomputing Demo CD, or any part of same, either alone or in conjunction      #
  15. # with other programs.                                                             #
  16. #                                                                                  #
  17. # The software contained on these discs is distributed as is, at no additional     #
  18. # charge. As such, it is excluded from any pre-existing customer service        #
  19. # or support agreements with Sun Microsystems. An email form is provided in        #
  20. # the main demo menu to direct comments, feedback and technical questions          #
  21. # relating strictly to Ultrapack, the demos and usage thereof.               #
  22. #                                                                                  #
  23. # run_demo:                                       #
  24. #                                                                                  #
  25. # Executable shell script for starting up the UltraPack                   #
  26. #         SMCC Desktop Systems Engineering                   #
  27. #        March 1996                                  #
  28. #                                                                                  #
  29. ####################################################################################
  30. echo "Loading, Please Wait .........."
  31.  
  32. if [ "$ULTRA_PACK_HOME" = "" ]; then
  33.     ULTRA_PACK_HOME=/cdrom/cdrom0
  34.     export ULTRA_PACK_HOME
  35. fi
  36.  
  37. if [ "$DEMO_BROWSER" = "" ]; then
  38.         HOTJAVAHOME=$ULTRA_PACK_HOME/HotJava
  39. else
  40.         echo "Using alternate directory for HotJava"
  41.         echo "Loading from: " $DEMO_BROWSER
  42.         HOTJAVAHOME=$DEMO_BROWSER;
  43. fi
  44.  
  45. export ULTRA_PACK_HOME
  46. DIR=$ULTRA_PACK_HOME
  47. export DIR
  48. #
  49. /bin/stty istrip
  50.  
  51. # This next section performs some magic tricks to prevent
  52. # HotJava from overriding the user's existing preferences. 
  53. # By re-directing the $HOME env var to /tmp, HotJava will 
  54. # look for a preferences file which we've created specifically  
  55. # for Ultrapack -- however, this also implies having some other
  56. # important files in the new "home" directory such as the Xdefaults 
  57. # file and Xauthority file.  
  58. cd /tmp
  59.  
  60. if [ -w /tmp/.Xdefaults ]; then
  61.     rm /tmp/.Xdefaults;
  62. fi
  63.  
  64. if [ -w /tmp/.Xauthority ]; then
  65.     rm /tmp/.Xauthority;
  66. fi
  67.  
  68. if [ -w /tmp/.mailcap ]; then
  69.     rm /tmp/.mailcap;
  70. fi
  71.  
  72. if [ -d /tmp/.hotjava ]; then
  73.     rm -rf /tmp/.hotjava;
  74. fi
  75. #
  76. # Unroll a temporary user directory in /tmp for 
  77. # HotJava so we don't step on the user's defaults.
  78. #
  79. tar xf $ULTRA_PACK_HOME/WWW/HotJavaPrefs.tar
  80. cp $HOME/.Xauthority /tmp/.
  81. HOME=/tmp
  82. export HOME
  83. #
  84. DISPLAY=:0.0
  85. export DISPLAY
  86. /usr/openwin/bin/xhost `/usr/bin/uname -n`
  87.  
  88. # The next set of variables are for specific libraries
  89. # and home variables of application components that we
  90. # already know about. If other applications are added
  91. # to the web, this is the place to define their env vars.
  92. #
  93. MOTIFHOME=/usr/dt
  94. export MOTIFHOME
  95.  
  96. XGLHOME=/opt/SUNWits/Graphics-sw/xgl
  97. export XGLHOME
  98.  
  99. XILHOME=/opt/SUNWits/Graphics-sw/xil
  100. export XILHOME
  101.  
  102. LEOTOOL2HOME=$ULTRA_PACK_HOME/holoview
  103. export LEOTOOL2HOME
  104.  
  105. TCL_LIBRARY=$LEOTOOL2HOME/lib/tcl
  106. export TCL_LIBRARY
  107.  
  108. XGLVRHOME=$LEOTOOL2HOME
  109. export XGLVRHOME
  110.  
  111. JAVAHOME=$ULTRA_PACK_HOME/java
  112.  
  113. CLASSPATH=$ULTRA_PACK_HOME/WWW/classes:$HOTJAVAHOME/lib/classes.zip:$JAVAHOME/lib
  114. export CLASSPATH
  115.  
  116. # The library path really shouldn't require setting, but we
  117. # use it for debugging and testing purposes from time to time
  118. # and you might want to as well....
  119. #
  120. LD_LIBRARY_PATH=/usr/openwin/lib:$XGLVRHOME/lib:$XGLHOME/lib:$MOTIFHOME/lib:$LEOTOOL2HOME:$XILHOME/lib
  121. export LD_LIBRARY_PATH
  122. PATH=/opt/SUNWspro/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/bin:/usr/sbin:/usr/ucb:/etc
  123. export PATH
  124.  
  125. cd $ULTRA_PACK_HOME/WWW
  126.  
  127. #
  128. # Figure out which video mode the user is in and display HotJava properly.
  129. #
  130. /usr/openwin/bin/xdpyinfo | grep 1280 > /tmp/vidmode
  131. if [ -s /tmp/vidmode ]; then
  132.     rm -f /tmp/vidmode;
  133.     $HOTJAVAHOME/bin/hotjava $ULTRA_PACK_HOME/WWW/h0.html
  134. else
  135.     rm -f /tmp/vidmode;
  136.     $HOTJAVAHOME/bin/hotjava $ULTRA_PACK_HOME/WWW/h0.html
  137. fi
  138. #
  139. #
  140. # Clean up after ourselves
  141. cd /tmp
  142.  
  143. if [ -w /tmp/.Xdefaults ]; then
  144.     rm /tmp/.Xdefaults;
  145. fi
  146.  
  147. if [ -w /tmp/.Xauthority ]; then
  148.     rm /tmp/.Xauthority;
  149. fi
  150.  
  151. if [ -w /tmp/.mailcap ]; then
  152.     rm /tmp/.mailcap;
  153. fi
  154.  
  155. if [ -d /tmp/.hotjava]; then
  156.     rm -rf /tmp/.hotjava;
  157. fi
  158.